import React, { useState } from 'react';
import Son from './components/son';


const Bar = ({ title }) => {
    return <div>这是Bar组件-{title}</div>
}

const Parent = () => {
    const [total, setTotal] = useState(0);
    return (
        <>
            <h1>这是父组件</h1>
            <Son>
                {
                    (title) => <Bar title={title}/>
                }
            </Son>
        </>
    )
};

export default Parent;